Skip to content

refactor: rename async middleware with Async*/async_* prefix; drop attempt_timeout#30

Merged
lesnik512 merged 11 commits into
mainfrom
feat/async-prefix-rename
Jun 7, 2026
Merged

refactor: rename async middleware with Async*/async_* prefix; drop attempt_timeout#30
lesnik512 merged 11 commits into
mainfrom
feat/async-prefix-rename

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

  • Renames Middleware → AsyncMiddleware, Next → AsyncNext, Retry → AsyncRetry, Bulkhead → AsyncBulkhead, before_request/after_response/on_error → async_before_request/..., compose → compose_async to align with httpx2's naming convention (sync default, Async* prefix on the async sibling).
  • Removes AsyncRetry(attempt_timeout=...). Whole-attempt wall-clock bounds were the only feature that depended on asyncio.timeout and have no clean sync equivalent. Users wanting whole-attempt bounds can compose a custom timeout middleware; per-phase I/O bounds remain available via httpx2.Timeout.
  • Pure mechanical rename. Zero behavior change.

Part 1 of 2. Part 2 (sync Client + sync middleware) lands separately and the combined work cuts one release.

Source spec: planning/specs/2026-06-07-sync-client-design.md.
Plan: planning/plans/2026-06-07-sync-client-plan.md Tasks A1–A10.

Breaking changes

  • All async middleware classes/types renamed (Async*/async_* prefix).
  • AsyncRetry(attempt_timeout=...) removed.

Test plan

  • just lint clean
  • just test all green (249 tests; coverage maintained at 100%)
  • mkdocs build --strict clean

🤖 Generated with Claude Code

lesnik512 and others added 11 commits June 7, 2026 14:13
Two-PR plan: PR 1 renames the async middleware surface and drops
attempt_timeout; PR 2 adds sync Client + sync middleware/Retry/Bulkhead
and makes RetryBudget thread-safe. Both PRs merge to main, then one
release tag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ync_ prefix

Aligns with httpx2's naming convention (sync default, Async* prefix on
the async sibling). Sync versions will land in PR 2.

Part of feat/async-prefix-rename. Suite is intentionally red until the
cascade completes; greens up in the same PR.
attempt_timeout used asyncio.timeout to bound the whole attempt. It has
no clean sync equivalent and the I/O slice is already covered by
httpx2's per-phase Timeout. Removed from both worlds; users who need
whole-attempt structured cancellation can compose a custom timeout
middleware.

Also drops the now-dead except builtins.TimeoutError branch (the only
source was asyncio.timeout) and the builtins import.
@lesnik512 lesnik512 self-assigned this Jun 7, 2026
@lesnik512 lesnik512 merged commit 28ab9da into main Jun 7, 2026
5 checks passed
@lesnik512 lesnik512 deleted the feat/async-prefix-rename branch June 7, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant